//
//  CapturePhotoViewLayout.m
//  Rail
//
//  Created by hychen on 2018/5/1.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "CapturePhotoViewLayout.h"

static const NSInteger kItemWH = 90;

@interface CapturePhotoViewLayout ()

/***  列数*/
@property (nonatomic, assign) NSInteger colCount;
/***  间隔*/
@property (nonatomic, assign) CGFloat colMargin;

@end

@implementation CapturePhotoViewLayout

- (instancetype)init {
    if (self = [super init]) {
        _colCount = 3;
        _colMargin = (SCREEN_WIDTH - kItemWH*_colCount)/_colCount;
    }
    return self;
}

- (void)prepareLayout {
    [super prepareLayout];
    
    CGFloat insetMargin = 15;
    
    self.itemSize = CGSizeMake(kItemWH, kItemWH);
    self.minimumLineSpacing = self.colMargin;
    self.minimumInteritemSpacing = self.colMargin;
    
    self.sectionInset = UIEdgeInsetsMake(0, insetMargin, 0, insetMargin);
}

@end
